package com.link.base.base.user.service;

import com.link.base.base.user.model.LoginLog;
import com.link.base.base.user.model.RespDTO;
import com.link.core.basic.service.BasicService;
import com.link.core.basic.service.BasicServiceException;

import javax.servlet.http.HttpServletRequest;

/**
 * @author unknown
 * @date unknown
 * @comments 用户登录记录
 */
public interface LoginLogService extends BasicService<LoginLog> {
    /**
     * 删除用户的登录失败记录
     *
     * @param userId 用户Id
     * @throws BasicServiceException
     */
    public void deleteByUserId(String userId) throws BasicServiceException;

    /**
     * 添加登录成功记录
     *
     * @param loginLog
     * @throws BasicServiceException
     */
    public void addLoginSuccessLog(LoginLog loginLog) throws BasicServiceException;

    /**
     * 添加登录失败记录
     *
     * @param loginLog
     * @throws BasicServiceException
     */
    public void addLoginFailLog(LoginLog loginLog) throws BasicServiceException;

    /**
     * 根据登录返回的DTO信息插入登录日志
     *
     * @author cuizhiyong
     * @param dto 登录成功后返回的登录信息对象
     * @date 2019/4/3
     */
    public void addLoginLogByRespDTO(RespDTO dto, HttpServletRequest request);

}
